import Login from '@views/login'
import Verification from '@views/verification'
import PageList from '@src/views/pageList'
import Home from '@src/views/home'
import NoFound from '@src/views/noFound'
import Institutions from '@src/views/institutions'
import Redirect from '@src/views/redirect'
import PublicNewsList from '@src/views/publicNewsList'
import PublicNewsDetail from '@src/views/publicNewsDetail'
import PublicGonggaoList from '@src/views/publicGonggaoList'
import PublicGonggaoDetail from '@src/views/publicGonggaoDetail'
import PublicKnowledgeDetail from '@src/views/publicKnowledgeDetail'
import PublicKnowledgeList from '@src/views/publicKnowledgeList'
import PublicArticleList from '@src/views/publicArticleList'
import PublicArticleDetail from '@src/views/publicArticleDetail'
import PublicDoclibList from '@src/views/publicDoclibList'
import Longfatong from '@src/views/longfatong'
import Registry from '@src/views/registry'
import { getUrlPre } from '@src/assets/js/tool'
import { root } from '@src/assets/js/config'
const p = getUrlPre()
function pre (s) {
  return `${root}/${p}${s}`
}
function getGatePre (s) {
  return `${root}/gate${s}`
}
const config = [
  {
    path: pre('/404'),
    component: NoFound,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: pre('/lftlogin'),
    component: Longfatong,
    exact: true,
    auth: false,
    verificate: false
  },
  {
    path: pre('/redirect'),
    component: Redirect,
    exact: false,
    auth: false,
    verificate: false
  },
  {
    path: getGatePre('/registry'),
    component: Registry,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/login'),
    component: Login,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: pre('/verification'),
    component: Verification,
    exact: true,
    auth: true,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/home'),
    component: Home,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/institutions/:p'),
    component: Institutions,
    exact: false,
    auth: true,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/public-news-list'),
    component: PublicNewsList,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/public-news-detail/:id'),
    component: PublicNewsDetail,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/public-gonggao-list'),
    component: PublicGonggaoList,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/public-gonggao-detail/:id'),
    component: PublicGonggaoDetail,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/public-knowledge-list'),
    component: PublicKnowledgeList,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/public-knowledge-detail/:id'),
    component: PublicKnowledgeDetail,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/public-article-list'),
    component: PublicArticleList,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/public-article-detail/:id'),
    component: PublicArticleDetail,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  },
  {
    path: getGatePre('/public-doclib-list'),
    component: PublicDoclibList,
    exact: true,
    auth: false,
    verificate: false,
    push: 'forward',
    pop: 'back',
  }
];
['haerbin', 'qiqihaer', 'mudanjiang', 'jiamusi', 'daqing', 'jixi', 'shuangyashan', 'yichun', 'qitaihe', 'hegang', 'heihe', 'suihua'].forEach(k => {
  config.push({
    path: `${root}/${k}/admin`,
    component: PageList,
    exact: false,
    auth: true,
    verificate: true,
    push: 'forward',
    pop: 'back',
  })
})

export default config
